package com.example.listener;

import com.example.annotation.RabbitmqListener;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Envelope;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chentao
 * @version 1.0
 * @description: TODO
 * @date 2025/3/18 下午11:36
 */
@RabbitmqListener(exchange = "sitc.fanout.exchange", queues = "sitc.fanout.user.queues_", type = BuiltinExchangeType.FANOUT)
public class SysFanoutUserMQMessageListener implements MQMessageListener {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public void onMessage(MQMessageListener mqMessageListener, String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws Exception {
        logger.warn("SysFanoutUserMQMessageListener mq message received: {}", new String(body));
    }
}
